package com.indsvr.entity.xunlei;

import com.google.gson.Gson;
import lombok.Data;

public enum XunLeiTaskStatusEnum {

    PHASE_TYPE_COMPLETE("完成",0),
    PHASE_TYPE_PENDING("等待",1),
    PHASE_TYPE_RUNNING("运行",2),
    PHASE_TYPE_PAUSED("暂停",3),
    PHASE_TYPE_ERROR("错误",4);

   private String msg;
   private int value;

    XunLeiTaskStatusEnum(String msg, int value) {
        this.msg = msg;
        this.value = value;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public static void main(String[] args) {
        String a = "{\"phase\": \"PHASE_TYPE_COMPLETE\"}";

        Taa taa = new Gson().fromJson(a, Taa.class);


        System.out.println(taa);


    }

    @Data
    public static class Taa{
        private XunLeiTaskStatusEnum phase;
    }

}
